extends "../cTDM_5/cTDM_5.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "死灵术士"
	lv = 3
	attCoe.atk = 25 / 8.5 * 2 / 3
	attCoe.maxHp = 800.5 / 112.5 / 3
	addSkillTxt("骷髅法师：普攻18%概率召唤一个骷髅法师，继承自身60%攻击，附加50%自身血量")
	addSkillTxt("骷髅骑士：普攻5%概率召唤一个骷髅骑士，攻击为70+自身30%攻击，附加50%自身血量")
var pw1 = 18
var pw2 = 5
func _onAtkChara(atkinfo):
	if atkinfo.hitCha != self && !atkinfo.isMiss && atkinfo.atkType == Chara.AtkType.NORMAL && atkinfo.atkCha == self:
		if sys.rndPer(pw1):
			yield(reTimer(0.01),"timeout")
			var cha = newChara("cex___Hide_skull1",self.cell)
			if !cha:
				var cells = utils.getAllyCells(team)
				for i in cells:
					if !cha:
						cha = newChara("cex___Hide_skull1",i)
			if cha:
				cha.isSumm = true
				cha.attInfo.atk = self.att.atk * 0.6
				cha.attInfo.maxHp += self.att.maxHp * 0.5
				
				cha.upAtt()
				cha.plusHp(cha.att.maxHp)
		if sys.rndPer(pw2):
			yield(reTimer(0.01),"timeout")
			var cha = newChara("cex___Hide_skull2",self.cell)
			if !cha:
				var cells = utils.getAllyCells(team)
				for i in cells:
					if !cha:
						cha = newChara("cex___Hide_skull2",i)
			if cha:
				cha.isSumm = true
				cha.attInfo.atk += self.att.atk * 0.3
				cha.attInfo.maxHp += self.att.maxHp * 0.5
				
				cha.upAtt()
				cha.plusHp(cha.att.maxHp)
	._onAtkChara(atkinfo) 
